const Router = require('koa-router');
const router = new Router({ prefix: '/api/knowLedge' });
const { HealthArticle } = require('../models/knowLedgeDataModels');

 

// 获取路由列表
router.get('/list', async (ctx) => {
  try {
    const res = await HealthArticle.findAll();
    
    ctx.body = {
      code: 200,
      message: '获取菜单列表成功',
      data: res
    };
  } catch (error) {
    ctx.body = {
      code: 500,
      message: '获取菜单列表失败',
      error: error.message
    };
  }
});

module.exports = router;